package com.lychee.blurbitmapdemo;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {
    private ImageView mImgView;
    private Context mContext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getSupportActionBar().hide();
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_main);
        mContext = this;

        mImgView = (ImageView) findViewById(R.id.mImgBack);
        Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.back);
        mImgView.setImageBitmap(BlurBitmap.blur(mContext, bitmap));

        //app  gradle 高斯模糊效果添加
//        renderscriptTargetApi 19
//        renderscriptSupportModeEnabled true
    }
}
